import sys
file = open("input.txt")
data = file.readlines()
N = int(data[0])
box = [0] + list(map(int, data[1].split()))
gas = [0] + [1] + [1000000] * (N - 1)
for i in range(N, 0, -1):
    j = i - 1
    while j > 0 and box[j] != box[i]:
        j -= 1
    if box[j] == box[i]:
        gas[i] = j